﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using NeuronDotNet.Samples.OCR.layoutsstategies;
using NeuronDotNet.Controls;

namespace NeuronDotNet.Samples.OCR
{
    class StringImageLayout
    {
        public Letter image;
        public LayoutStrategy layoutStr;

        public StringImageLayout(Letter image, LayoutStrategy layoutStr)
        {
            this.image = image;
            this.layoutStr = layoutStr;
        }
        
        public List<Letter> GetClippedLetters()
        {
            return GetClippedLetters(layoutStr.GetDivision());
        }

        public List<Letter> GetClippedLetters(List<Rectangle> rects)
        {
            List<Letter> res = new List<Letter>();

            foreach (Rectangle rect in rects)
            {
                res.Add(image.MakeCliped(rect));
            }

            return res;
        }
    }
}
